<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <style>
        body{
            margin: auto 0;
        }
        #outer{
            /*border: 1px solid red;*/
            text-align: center;
        }
    </style>
</head>
<body>
    <div id="outer">
        <img src="/imgs/你怎么这么自私.jpg"> <br>
        <a href="javascript:change(0)">1</a> &nbsp;&nbsp;
        <a href="javascript:change(1)">2</a> &nbsp;&nbsp;
        <a href="javascript:change(2)">3</a> &nbsp;&nbsp;
    </div>

    <script>
        //模拟数据
        let arr = ["你怎么这么自私.jpg","墨镜流泪.webp","火男压不住火了.jpg"]
        //获取img对象
        let img = document.getElementsByTagName("img")[0];
        function change(n){
            img.src = '/imgs/'+arr[n];
        }
    </script>
</body>
</html>